<?php echo $header; ?>
<?php if ($error_warning) { ?>

<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
<?php echo $content_top; ?>
<div class="breadcrumb">
  <?php foreach ($breadcrumbs as $breadcrumb) { ?>
  <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
  <?php } ?>
</div>
<!-- 联盟注册表单 -->
<div class="page-header">
  <h1><?php echo $heading_title; ?></h1>
</div>
<p><?php echo $text_account_already; ?></p>
<p><?php echo $text_signup; ?></p>
<form class="form-horizontal" action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
  <!-- 个人资料 -->
  <fieldset>
    <legend><?php echo $text_your_details; ?></legend>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_firstname; ?></label>
      <div class="controls">
        <input class="span2" type="text" name="firstname" value="<?php echo $firstname; ?>" />
        <?php if ($error_firstname) { ?>
        <span class="error"><?php echo $error_firstname; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_lastname; ?></label>
      <div class="controls">
        <input class="span2"  type="text" name="lastname" value="<?php echo $lastname; ?>" />
        <?php if ($error_lastname) { ?>
        <span class="error"><?php echo $error_lastname; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_email; ?></label>
      <div class="controls">
        <input type="text" name="email" value="<?php echo $email; ?>" />
        <?php if ($error_email) { ?>
        <span class="error"><?php echo $error_email; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_telephone; ?></label>
      <div class="controls">
        <input type="text" name="telephone" value="<?php echo $telephone; ?>" />
        <?php if ($error_telephone) { ?>
        <span class="error"><?php echo $error_telephone; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><?php echo $entry_fax; ?></label>
      <div class="controls">
        <input type="text" name="fax" value="<?php echo $fax; ?>" />
      </div>
    </div>
  </fieldset>
  <fieldset>
    <legend><?php echo $text_your_address; ?></legend>
    <div class="control-group">
      <label class="control-label"><?php echo $entry_company; ?></label>
      <div class="controls">
        <input type="text" name="company" value="<?php echo $company; ?>" />
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><?php echo $entry_website; ?></label>
      <div class="controls">
        <input type="text" name="website" value="<?php echo $website; ?>" />
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_address_1; ?></label>
      <div class="controls">
        <input type="text" name="address_1" value="<?php echo $address_1; ?>" />
        <?php if ($error_address_1) { ?>
        <span class="error"><?php echo $error_address_1; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><?php echo $entry_address_2; ?></label>
      <div class="controls">
        <input type="text" name="address_2" value="<?php echo $address_2; ?>" />
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_city; ?></label>
      <div class="controls">
        <input class="span2"  type="text" name="city" value="<?php echo $city; ?>" />
        <?php if ($error_city) { ?>
        <span class="error"><?php echo $error_city; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_postcode; ?></label>
      <div class="controls">
        <input class="span2" type="text" name="postcode" value="<?php echo $postcode; ?>" />
        <?php if ($error_postcode) { ?>
        <span class="error"><?php echo $error_postcode; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_country; ?></label>
      <div class="controls">
        <select name="country_id" onchange="$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=' + this.value + '&zone_id=<?php echo $zone_id; ?>');">
          <option value="false"><?php echo $text_select; ?></option>
          <?php foreach ($countries as $country) { ?>
          <?php if ($country['country_id'] == $country_id) { ?>
          <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
          <?php } else { ?>
          <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
          <?php } ?>
          <?php } ?>
        </select>
        <?php if ($error_country) { ?>
        <span class="error"><?php echo $error_country; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_zone; ?></label>
      <div class="controls">
        <select name="zone_id">
        </select>
        <?php if ($error_zone) { ?>
        <span class="error"><?php echo $error_zone; ?></span>
        <?php } ?>
      </div>
    </div>
  </fieldset>
  
  <!-- 付款信息 -->
  <fieldset>
    <legend><?php echo $text_payment; ?></legend>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_tax; ?></label>
      <div class="controls">
        <input type="text" name="tax" value="<?php echo $tax; ?>" />
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"> <?php echo $entry_payment; ?></label>
      <div class="controls">
        <?php if ($payment == 'cheque') { ?>
        <label for="cheque" class="radio">
          <input type="radio" name="payment" value="cheque" id="cheque" checked="checked" />
          <?php } else { ?>
          <input type="radio" name="payment" value="cheque" id="cheque" />
          <?php } ?>
          <?php echo $text_cheque; ?></label>
        <label for="paypal" class="radio">
          <?php if ($payment == 'paypal') { ?>
          <input type="radio" name="payment" value="paypal" id="paypal" checked="checked" />
          <?php } else { ?>
          <input type="radio" name="payment" value="paypal" id="paypal" />
          <?php } ?>
          <?php echo $text_paypal; ?> </label>
        <label for="bank" class="radio">
          <?php if ($payment == 'bank') { ?>
          <input type="radio" name="payment" value="bank" id="bank" checked="checked" />
          <?php } else { ?>
          <input type="radio" name="payment" value="bank" id="bank" />
          <?php } ?>
          <?php echo $text_bank; ?></label>
      </div>
    </div>
    <div id="payment-cheque" class="payment">
      <div class="control-group">
        <label class="control-label"> <?php echo $entry_cheque; ?></label>
        <div class="controls">
          <input type="text" name="cheque" value="<?php echo $cheque; ?>" />
        </div>
      </div>
    </div>
    <div class="payment" id="payment-paypal">
      <div class="control-group">
        <label class="control-label"> <?php echo $entry_paypal; ?></label>
        <div class="controls">
          <input type="text" name="paypal" value="<?php echo $paypal; ?>" />
        </div>
      </div>
    </div>
    <div id="payment-bank" class="payment">
      <div class="control-group">
        <label class="control-label"> <?php echo $entry_bank_name; ?></label>
        <div class="controls">
          <input type="text" name="bank_name" value="<?php echo $bank_name; ?>" />
        </div>
      </div>
      <div class="control-group">
        <label class="control-label"> <?php echo $entry_bank_branch_number; ?></label>
        <div class="controls">
          <input type="text" name="bank_branch_number" value="<?php echo $bank_branch_number; ?>" />
        </div>
      </div>
      <div class="control-group">
        <label class="control-label"><?php echo $entry_bank_swift_code; ?></label>
        <div class="controls">
          <input type="text" name="bank_swift_code" value="<?php echo $bank_swift_code; ?>" />
        </div>
      </div>
      <div class="control-group">
        <label class="control-label"> <?php echo $entry_bank_account_name; ?></label>
        <div class="controls">
          <input type="text" name="bank_account_name" value="<?php echo $bank_account_name; ?>" />
        </div>
      </div>
      <div class="control-group">
        <label class="control-label"> <?php echo $entry_bank_account_number; ?></label>
        <div class="controls">
          <input type="text" name="bank_account_number" value="<?php echo $bank_account_number; ?>" />
        </div>
      </div>
    </div>
    
  </fieldset>
  
  <!-- 联盟会员密码 -->
  <fieldset>
    <legend><?php echo $text_your_password; ?></legend>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_password; ?></label>
      <div class="controls">
        <input type="password" name="password" value="<?php echo $password; ?>" />
        <?php if ($error_password) { ?>
        <span class="error"><?php echo $error_password; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_confirm; ?></label>
      <div class="controls">
        <input type="password" name="confirm" value="<?php echo $confirm; ?>" />
        <?php if ($error_confirm) { ?>
        <span class="error"><?php echo $error_confirm; ?></span>
        <?php } ?>
      </div>
    </div>
  </fieldset>
  <?php if ($text_agree) { ?>
  <div class="buttons well">
    <label class="checkbox">
      <?php if ($agree) { ?>
      <input type="checkbox" name="agree" value="1" checked="checked" />
      <?php } else { ?>
      <input type="checkbox" name="agree" value="1" />
      <?php } ?>
      <?php echo $text_agree; ?> </label>
  </div>
  <div class="pull-right">
    <input type="submit" value="<?php echo $button_continue; ?>" class="btn btn-large btn-primary span2" />
  </div>
  <?php } else { ?>
  <div class="pull-right">
    <input type="submit" value="<?php echo $button_continue; ?>" class="btn btn-large btn-primary span2" />
  </div>
  <?php } ?>
</form>
</div>
<?php echo $content_bottom; ?>
</div>
<script type="text/javascript"><!--
$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=<?php echo $country_id; ?>&zone_id=<?php echo $zone_id; ?>');
//--></script> 
<script type="text/javascript"><!--
$('input[name=\'payment\']').bind('change', function() {
	$('.payment').hide();
	
	$('#payment-' + this.value).show();
});

$('input[name=\'payment\']:checked').trigger('change');
//--></script> 
<script type="text/javascript"><!--
$('.colorbox').colorbox({
	width: 560,
	height: 560
});
//--></script> 
<?php echo $footer; ?>